﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Starfire3d.Data.States;

namespace Starfire3d.Data.States.GameStates
{
    public class OptionsScreen : BaseState<GameManager>
    {
       public override void Enter(GameManager entity)
        {
            System.Console.Clear();
            System.Console.WriteLine("Please enter the number if players(2-9, Esc to quit): ");
        }

       public override void Execute(GameManager entity)
       {
           ConsoleKeyInfo key = System.Console.ReadKey();
           if (key.Key == ConsoleKey.Escape)
           {
               entity.Quitting = true;
           }
           else if (key.KeyChar >= '2' && key.KeyChar <= '9')
           {
               entity.NumOfPlayers = key.KeyChar - 48;
               entity.StateMachine.ChangeState(new GameScreen());
           }
       }

        public override void Exit(GameManager entity)
        {
            System.Console.Clear();
        }
    }
}
